package me.luger.provider.service;

import io.grpc.stub.StreamObserver;
import me.luger.dubbo3.entity.DubboMusicServiceGrpc;
import me.luger.dubbo3.entity.GetMusicByIdReply;
import me.luger.dubbo3.entity.GetMusicByIdRequest;
import org.apache.dubbo.config.annotation.DubboService;

@DubboService
public class MusicServiceImpl extends DubboMusicServiceGrpc.MusicServiceImplBase implements DubboMusicServiceGrpc.IMusicService {
    @Override
    public void getMusicById(GetMusicByIdRequest request, StreamObserver<GetMusicByIdReply> responseObserver) {
        Long id = request.getId();
        GetMusicByIdReply getMusicByIdReply = GetMusicByIdReply.newBuilder().setName("七里香" + id).setAlbum("hhh").setArtist("luger").build();
        responseObserver.onNext(getMusicByIdReply);
        responseObserver.onCompleted();
    }
}
